home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / misc / prnf246.zip / MANGLER.DOC < prev    next >
Text File  |  1994-12-20  |  40KB  |  700 lines

  1.  
  2. _______MANGLER                                                           Ver. 2.61
  3.  
  4.  
  5.  
  6. Purpose: Reads an ASCII text file, performs various kinds of minor surgery
  7.          on it, paying due respect to bare carriage returns, and writes the
  8.          result into another file.  Mangler can do a lot of different
  9.          things, but not all at once; you may want to run it several times
  10.          over the same text.
  11.  
  12. Format:     MANGLER [infilespec [outfilespec] [/+|/-] [/REC] [xxxxxxx]]
  13.  
  14.          None of these parameters are necessary.  Mangler is designed to be
  15.          an interactive program, and whatever you don't specify on the com-
  16.          mand line will be asked for.  If you want to run it from a batch
  17.          file, however, you can provide everything on the command line so
  18.          it doesn't have to stop and ask.
  19.  
  20.          If you do put parameters on the command line, the first one must
  21.          specify the file Mangler is to read and process; if the second
  22.          parameter does not begin with a "/",[1] it's the file in which to
  23.          write the output.  If you don't specify the second filename,
  24.          Mangler will construct one and offer it.  The new file will have
  25.          the same date and time as the original.  Notice that whatever
  26.          filespecs you want to give must precede any parameter that begins
  27.          with a slash.
  28.  
  29.          /+ and /- instruct Mangler, respectively, to rerun or not rerun
  30.          itself automatically.  Mangler is a program you may want to run
  31.          several times on the same text, so when it's finished, it normally
  32.          asks whether you want to run it again.  To run Mangler from a
  33.          batch file without interaction, /+ or /- on the command line will
  34.          quash that request.
  35.  
  36.          /REC makes MANGLER record your keystrokes.  It helps you work out
  37.          what keyboard stuffing you need to make MANGLER work from a batch
  38.          file.  There are too many possible combinations of commands to
  39.          list here, but set the /REC option and punch through the operation
  40.          you want to order from a batch file.  File MANGLER.KEZ will then
  41.          have a record of the parameters you put on the command line plus
  42.          the keystrokes you entered during the run.  With a little editing,
  43.          that's what you put into the batch file.
  44.  
  45.          Any characters thereafter are treated as keyboard stuffing.  The
  46.          point of the keyboard stuffing is to give you a chance to set up
  47.          automatic responses for a batch file.  For the syntax of the key-
  48.          board stuffing characters, see page 8, below.
  49.  
  50. Remarks: After the files it's to work on are settled, you get to choose
  51.          from a menu bar.  Either move the cursor bar and press <Enter> or
  52.          just press the first letter of the choice you want.  If you make a
  53.  
  54.  
  55.  
  56. -----------
  57.  
  58.  
  59. 1. or "^M" or "#13" --see "Keyboard Stuffing", p. 8, below.
  60. _______MANGLER 2.61                                                         Page 2
  61.  
  62.  
  63.          mistake, you can (almost) always back up by pressing <Esc>.  Here
  64.          are the choices and what they do:
  65.  
  66.            _______ ______ ______ ______ _______ ______ _____ _______ ____           Mrg/Tab DelRep Hi-bit CrSwap Ln Ends SpFile InsFF Reverse Quit
  67.  
  68.          _______         Mar\Tab gets you a sub-menu, with the following offerings:
  69.  
  70.              __________             Add Margin: adds blanks to the beginning of each line.  You're
  71.                  asked how many.
  72.  
  73.                  You'll also be asked whether to insert blanks after CR's,
  74.                  too.  If the file contains bare CR's, you should answer
  75.                  "Y" to keep the overprinting even with the main line.
  76.                  It's made optional only to deal with freaks and blunders.
  77.  
  78.                  Finally, you're asked how to expand tabs.  Setting tab
  79.                  width to 0 makes Mangler leave tabs alone, but this is
  80.                  unwise.  Pushing the margins back and forth raises hob
  81.                  with tabbed intervals.
  82.  
  83.                  Normally, it's better to add margins in Pagina, as part of
  84.                  the basic page formation, or in Prn2Both if you're going
  85.                  to print on both sides, but if you want your headers to
  86.                  extend a little to the left of the text, you can add a few
  87.                  columns of blank margin here, before you run Pagina.
  88.  
  89.              _____________             Remove Margin: removes blanks and tabs at the beginning of
  90.                  each line. It won't remove any other characters.  Here,
  91.                  too, you're asked how many, whether to do it after bare
  92.                  CR's, and how to expand tabs.
  93.  
  94.                  You remove the margin to permit more flexible choices of
  95.                  margin, alternating headers, &c. when you paginate, and
  96.                  especially if you're going to use Prn2Both, which prefers
  97.                  marginless text.  If you don't know how much margin the
  98.                  file has, ask CountPgs.
  99.  
  100.              ___________             Expand Tabs expands tab characters into a suitable number of
  101.                  blanks.  Default width is 8 columns.
  102.  
  103.              ______________             Tab the Spaces reverses the Expand procedure: packs blanks
  104.                  into tabs.  Saves a little file space; otherwise useless.
  105.  
  106.          ______         DelRep (delete/replace): removes every occurrence of a given char-
  107.              acter or string from the file, replacing them, if you like,
  108.              with something else.  It was made to remove form-feed charac-
  109.              ters (ASCII #12), when you intend to re-paginate a file, but
  110.              you can work it on any characters you like.  To remove a char-
  111.              acter or string of characters, replace it with nothing.  If
  112.              you ask DelRep to replace a string with itself (same string
  113.              for "Replace what" and for "Replace it with what"), Mangler
  114.                          _____             will merely count the occurences of the string, without making
  115.              any changes and without creating an output file at all.
  116. _______MANGLER 2.61                                                         Page 3
  117.  
  118.  
  119.              To tell Mangler what strings to use, you can enter most char-
  120.              acters in the normal way, but not things like the high-bit
  121.              graphics characters or the backspace character, ASCII 8.  The
  122.              simplest way to enter them is to use the # sign followed by
  123.              the ASCII number (#8 for backspace), but you can also use the
  124.              caret representing "Control" to make Ctrl-Characters like ^M
  125.              for "Ctrl-M" (alias "carriage return", alias <Enter>).  This
  126.              means, of course, that you can't enter a "#" or a "^" plain.
  127.              If you want to specify one of these characters, you must put a
  128.              backslash (\) in front of it (\# for the "#" character, \\ for
  129.              the backslash).  See the section on "Keyboard Stuffing" on
  130.              page 8 for more about these symbols.
  131.  
  132.              An example: one use for DelRep is converting Unix text files
  133.              to DOS.  Unix separates lines with one line-feed character;
  134.              DOS does it with a pair: line-feed followed by a carriage
  135.              return.  To convert Unix files to DOS, replace ^J with ^M^J.
  136.              To convert DOS files to Unix, replace ^M^J with ^J.  I keep a
  137.              batch file for the purpose, containing the line:
  138.  
  139.                 mangler %1  /- ^Md"^J"^M"^M^J"^MYN
  140.  
  141.          ______         Hi-bit (High-bit filter): Produces a menu offering several ways to
  142.              deal with the "high-Bit" characters from ASCII #128 to ASCII
  143.              #255.  Here are the options and what they do:
  144.  
  145.              _____________             Strip Hi-Bits: is the usual cure for WordStar "documents".
  146.                  Change characters above #127 to ordinary ones.  It avoids
  147.                  the mess that happens if you try to send 8-bit character
  148.                  (ASCII 0 - 255) through a system that can handle only 7-
  149.                  bit characters (below #128), but it ruins box character
  150.                                                                    ___                 graphics and generaly makes hash unless it really was a
  151.                  WordStar document.
  152.  
  153.              _____________             Dot the Highs: puts dots for all unprintables (Hi-bit chars
  154.                  and most of the #0-#31 "command" chars), a less dangerous
  155.                  way to avoid high-bit characters.
  156.  
  157.              ______________             Lower Box Char: replaces "graphics" box drawing characters
  158.                  with plain "--", "|" etc.  If your text has lines and
  159.                  boxes drawn with the IBM/Epson "graphics" characters and
  160.                  you want to print it or transmit it with a 7-bit device,
  161.                  this option does a fair job of reproducing the design with
  162.                  characters in the safe range below #128.  This does
  163.                  nothing to other high-range characters.  You may want to
  164.                  run this once to preserve the boxes, and then run "Dot the
  165.                  Highs" to defang the others.
  166.  
  167.              ______________             Raise Box Char: replaces crude "--", "|" box characters with
  168.                  hi-bit graphics ones.  Just the reverse of the above.  If
  169.                  you have a text with lines and boxes drawn with the low-
  170.                  range characters, this will pretty it up by converting to
  171.                  the high-range graphics characters.  Mangler makes an
  172.                  effort to sort out ordinary hyphens and equal signs from
  173.                  box lines by checking the context, but you may want to
  174. _______MANGLER 2.61                                                         Page 4
  175.  
  176.  
  177.                  check it by hand.  Look especially for places where a "-"
  178.                  or a "=" might get treated like box characters.  (In a
  179.                  batch file, all the double equal signs, "==", will be
  180.                  turned to graphics.)  Sometimes, a run or two of Mangler's
  181.                  DelRep will do the trick, or you may have to go in with an
  182.                  editor.  (But, make sure first, that your editor can
  183.                  handle the high-range characters.)
  184.  
  185.              NOTE: At present, the last two: Raise and Lower Box Char can't
  186.                  handle bare CR's.  Perhaps in a future version. . .
  187.  
  188.          _______         CR Swap: to make sure a text with bare CR's is readable on the
  189.              screen, this function plays frontsy backsy around the first
  190.              bare CR (if there is one) in each line.
  191.  
  192.              To explain: The DOS convention for text files marks the end of
  193.              a line with a CR  followed by an LF (line feed, ASCII #10).
  194.              That's where you usually find CR's, but some files use CR's
  195.                                                    _____________________             plain to make the printer back up and overprint with under-
  196.              ______             scores or whatever for special effects.  There's a difficulty,
  197.              though.  When the file is viewed on the screen, as people are
  198.              likely to do with a DOC file, if the underscore line comes
  199.              after the text, it overprints and hides it.  What you must do
  200.                                     _____             is put the underscores first, then the CR, and finally the
  201.              text.  This way, the text overprints the underscores, and the
  202.              users see the text (but not the underscores).
  203.  
  204.              This is why you need the CR Swap function.  Most word process-
  205.                                                               _____             ors that use the CR this way put the underscores after the
  206.              line of text.  This will move them to the front.
  207.  
  208.          _______         Ln Ends: gets you a short menu which offers the following:
  209.  
  210.              ______________             Soften Returns: Prepares an ASCII text for use in a word pro-
  211.                  cessor.  Most word processors distinguish between "hard"
  212.                  returns which separate paragraphs and "soft" ones that in-
  213.                  dicate line-ends.  To a word processor, the ASCII CR/LF
  214.                  pair for line ends looks like a hard return.  This func-
  215.                  tion does a fair job of guessing which of your ASCII line-
  216.                          ___                 ends do not indicate paragraph breaks and replacing them
  217.                  with whatever your word processor wants (you get to speci-
  218.                  fy).  Word Perfect 5.1 uses #13 (CR without LF), my old
  219.                  FinalWord uses #255.  If you don't know what yours uses,
  220.                  try spaces (#32).  You also get to specify whether to
  221.                  count an indentation as a paragraph marker.  Two warnings,
  222.                  though:
  223.  
  224.                   1. Generally, Mangler takes an empty line to indicate the
  225.                      end of a paragraph.  But, it doesn't think a line con-
  226.                      taining blanks is an empty one.  If you're converting
  227.                      a text that fills out lines with blanks (as a screen
  228.                      print would), you may want to run the Bobtail Blanks
  229.                      function below on a text before you soften the re-
  230.                      turns.
  231. _______MANGLER 2.61                                                         Page 5
  232.  
  233.  
  234.                   2. This method is crude.  It will get your word-processor
  235.                      to digest the text, but you may have to do a lot of
  236.                      hand work afterwards to restore things like tables and
  237.                      footnotes.
  238.  
  239.              _____________             Pad Line Ends fills out the end of each line with blanks to a
  240.                  specified minimum length.  Sometimes useful to prevent an
  241.                  over-helpful editor from re-formatting your text during an
  242.                  ASCII upload.
  243.  
  244.              ______________             Bobtail Blanks strips blanks and tabs from the ends of lines.
  245.  
  246.          ______         SpFile (Split File): divides the file into several smaller ones.
  247.              Many editors cannot handle files larger than 64K bytes, so it
  248.              may be convenient to cut it into manageable pieces.  You get
  249.              to say how big.  (The default is 60K.)  Mangler takes the
  250.              drive, path and filename of your outfilespec, ignores any ex-
  251.              tension, and uses consecutive numbers starting with 001 for
  252.              the extension.  If you ask it to split C:\TXT\FOO.TXT into
  253.              D:\OUTFOO or D:\OUTFOO.XXX, Mangler will put the text into
  254.              D:\OUTFOO.001, D:\OUTFOO.002, etc.  When you've finished, you
  255.              can reassemble them with the DOS command:
  256.  
  257.                 COPY D:\OUTFOO.* C:\TXT\FOO.DOC
  258.  
  259.              Note: When the SpFile operation is done, Mangler will termin-
  260.                  ate, regardless of /+ in the command line or any previous
  261.                  request to "run another round".
  262.  
  263.          _____         InsFF (Insure FF's): Allows you to rework the existing page breaks
  264.              and remove page headers and footers.  At a minimum, it insures
  265.              that the file is paged with form-feed characters.  It inserts
  266.              an FF every so many lines (unless it finds an FF first), de-
  267.              letes blank lines at the bottom of each page, and (like all
  268.              the Mangler functions) deletes blanks at the ends of lines.
  269.  
  270.              This feature is intended for files which are paged with blank
  271.              lines instead of form-feeds.  Such a file is committed to a
  272.              specific number of lines per page.  Usually, they're laid out
  273.              for 8.5" x 11" paper at 66 lines per page.  To print it small,
  274.              say 5.5" x 8.5", you can set the printer to use condensed type
  275.              (16 or 17 chars/inch) at 8 lines/inch vertically.  That fits a
  276.              page laid out for normal paper into the right size to be cut
  277.              and punched for the small binders, but now its 66 line pages
  278.              don't come out even with the paper.  The cure is: convert from
  279.              blank line paging to FF's.  Hence, InsFF.
  280.  
  281.              InsFF will also offer to insert extra FF's.  If you intend to
  282.              print the file on two sides of the paper you may need a blank
  283.              page here and there to prevent things like printing the first
  284.              page of text on the back of the title page.  (The easy way to
  285.              do this is to pull the text into an editor and insert FF's
  286.              where you want.  Unfortunately, most editors --check yours--
  287.              bungle bare CR's.  If yours does, you'll have to use Mangler
  288.              to insert extra FF's into a file that uses CR's for underlin-
  289. _______MANGLER 2.61                                                         Page 6
  290.  
  291.  
  292.              ing &c.)  If you ask for several extras, don't get confused
  293.              about which page is which.  InsFF doesn't count the extras as
  294.              it inserts them.  So, if you call for extras after the 1st and
  295.                                                   ________             4th pages, you'll get them after the original 1st and 4th.  Of
  296.              course the first extra will become the second page of the new
  297.              file, and the second extra will be the new 6th page.
  298.  
  299.              If you don't ask for extras, you're offered a chance to "clean
  300.              up the top of the page, too".  If you decline, you're asked if
  301.                                     ___             you want to remove any non-blank lines from headers or foot-
  302.              ers.[2]  There's no harm in running InsFF over the same file
  303.              several times, once to add some extra FF's, say, and again to
  304.              clean up the tops or remove some header lines.
  305.  
  306.              Ordinarily, if you need to run Mangler on a file already paged
  307.              with FF's, make sure the number of lines you ask for is at
  308.                    ___             least two greater than the number already on the longest page
  309.              in the file.  That puts the page breaks are where they are in
  310.              the original and also makes sure Mangler won't insert unwanted
  311.              extras.  Of course, if you don't like the original paging, you
  312.              can remove it by deleting the FF's (ASCII #12) with DelRep.
  313.  
  314.              InsFF is useful with files badly laid out in various ways; for
  315.              instance, you can add headers or footers to a file that's al-
  316.              ready paged by running Mangler's InsFF, telling Mangler to in-
  317.              sert the FF's every 66 lines.  If you know what the existing
  318.              headers & footers are, you can get Mangler to remove them en-
  319.              tirely or in part, and make room for yours.  Removing footer
  320.              lines is sometimes tricky: Mangler can be confused if the
  321.              footer has blank lines after it.  The cure is to run InsFF
  322.              plain, to clean out all the blank lines between the footer and
  323.              the end of page.  Then run it again with instructions to re-
  324.              move the footer lines.  Finally, run Pagina to install your
  325.              own headers.  When you have the file properly mangled, Count-
  326.              Pgs will tell you whether the longest page has room for what
  327.              you want to insert.  You may have to use {.HPnn} to enlarge
  328.              Pagina's 63 line per page default.
  329.  
  330.                             _______             If the file is totally unpaged, it's better to go at it with
  331.              Pagina in the first place.
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339. -----------
  340.  
  341.  
  342. 2. You may have to run InsFF several times if you want to remove footer
  343.    lines.  Mangler can't remove footer lines unless they're at the very
  344.    bottom of the page.  To make sure there are no blank lines below the
  345.                                                     _______   footer, it's wise to begin by running InsFF once without removing
  346.    footers.
  347. _______MANGLER 2.61                                                         Page 7
  348.  
  349.  
  350.          ______         Revrse: Reverses the order of pages so the last page will be prin-
  351.              ted first.  Under certain circumstances, sheet-feeder printers
  352.              may require this:
  353.  
  354.              (a) If your printer stacks the pages print side up (like HP's
  355.                  DeskJet), it will collate backwards.  Reversing the order
  356.                  of the pages before printing fixes it.  (Backwards back-
  357.                  wards is forwards.)
  358.  
  359.                  To print on both sides of the paper, use Prn2Both to split
  360.                  the file into odd and even paged files.  Print one, turn
  361.                  the paper and print the other file on the back.  On a con-
  362.                  tinuous feed printer it's pretty intuitive, but sheet-
  363.                  feeders are a tad more complicated.  If the printer stacks
  364.                                                        ___                 its output print side up, reverse the odd paged file but
  365.                  not the even paged file.  Print one file, turn the paper
  366.                  around so it goes in head first, and print the other on
  367.                                                          ______                 the back.  (The new print is put on the bottom of the
  368.                  paper as it lies in the feeder tray).
  369.  
  370.              (b) If the printer does collate properly by stacking the out-
  371.                  put print side down, you don't need to reverse anything.
  372.                  To print on both sides, however, do the even pages first
  373.                  and the odd pages on the back.
  374.  
  375.                                                                   ___             (c) I don't know of a printer that puts the print on top of
  376.                  the paper as it comes in.  If yours does, you'll have to
  377.                  reverse the instructions above.  More or less.
  378.  
  379.              A word of warning: The Revrse function requires that the file
  380.              be correctly paginated with FF;s.  It will drop all characters
  381.              after the last FF, and it will choke on a page with too many
  382.              characters between FF's.  If you're not sure, CountPgs will
  383.              tell you all about the pagination.  Pagina, of course, will
  384.              leave the text in the proper condition.  If the file is al-
  385.              ready paginated, Mangler's InsFF function will insure that the
  386.              pages are marked with FF's.
  387.  
  388.          ____         Quit: Quits.
  389.  
  390. _______MANGLER 2.61                                                         Page 8
  391.  
  392.  
  393. About Keyboard Stuffing:
  394.  
  395.  
  396.          If you want to run Mangler from a batch file without having to en-
  397.          ter instructions from the keyboard at run-time, you have to sup-
  398.          ply, in advance, all the characters that will be required.  The
  399.          rules go like this:
  400.  
  401.              - The first parameter must be the name of the file to be read.
  402.  
  403.              - If the 2nd parameter does not begin with a slash (/) or a
  404.                carriage return sign (^M or #13), it is the name of the file
  405.                to be written.
  406.  
  407.                                     ____             - If the 2nd parameter does begin with a slash or carriage re-
  408.                turn sign (that is: /REC or /+ or /- or ^M or #13), Mangler
  409.                uses its automatically generated output file name
  410.                (FILENAME.001, FILENAME.002, &c.).
  411.  
  412.              - After the first two names or after any parameter that starts
  413.                                                      ___               with a slash, any parameter that does not begin with a
  414.                slash, in fact all the remaining characters will be stuffed
  415.                into a keyboard buffer.  They'll be fed to Mangler just as
  416.                if you were entering them from the keyboard.
  417.  
  418.          If you want to automate a run of Mangler, as you must if you want
  419.          to run it from a batch file, you have to put all the characters
  420.          you'd enter from the keyboard into that last parameter.  That can
  421.          be awkward to work out.  The easiest way is to use the /REC param-
  422.          eter and step Mangler through the operation by hand.  File MANG-
  423.          LER.KEZ will then contain the command line you just used plus the
  424.          strokes you entered during the run.  Make sure it was a clean run.
  425.                                                    ___         If you make mistakes and have to back up, all the keystrokes,
  426.          including the mistakes will show up in MANGLER.KEZ, with the up-
  427.          shot that both you and Mangler become confused.[3]  It is possible
  428.          to correct such a file, but it's usually easier to write it from
  429.          scratch, or even better: just scrub the MANGLER.KEZ file and make
  430.          another run.
  431.  
  432.          Sometimes, you can simply copy MANGLER.KEZ into your batch file
  433.          and use it as is, but you can edit it with any ASCII editor, and
  434.          sometimes you must.  In some places, you need to enter something
  435.          like <Enter> or <Ctrl-Enter>.  You can't just punch <Enter> (DOS
  436.          wouldn't put it in the string: it would simply obey it).  There
  437.          are two conventions for representing control characters that Mang-
  438.          ler understands:
  439.  
  440.  
  441. -----------
  442.  
  443.  
  444. 3. If you use the editing keys, you'll see some odd things.  Backspace is
  445.    simply ^H, but all the cursor pad keys take two characters, the first of
  446.    which is always #0.  Zero shows up as ^@, so you'll see things like ^@M
  447.    for left-arrow, ^@K for right-arrow and ^@S for delete.
  448. _______MANGLER 2.61                                                         Page 9
  449.  
  450.  
  451.          (a) Any character, including the control characters, can be indic-
  452.              ated by its ASCII number preceded by # (#13 means CR <Enter>
  453.              #10 means LF <Ctrl-Enter>, #92 means "\", etc).
  454.  
  455.          (b) Control characters (#0 through #31) can also be indicated by
  456.              the caret-with-capital-letter convention.  ^A (pronounced
  457.              "Control-A") indicates character #1, ^B means #2, etc.  Thus,
  458.              ^M (the 13th letter) indic ates #13 or <Enter>.  ^J makes
  459.              <Control-Enter> (or ASCII 10).
  460.  
  461.          Don't put spaces in these sequences unless you would enter one in
  462.          answer to one of Mangler's prompts.  Here's an example:
  463.  
  464.             MANGLER FILENAME.DOC FILENAME.001 I^M^MN^J^MN
  465.  
  466.             MANGLER FILENAME.DOC #13I#13#13N#10#13n
  467.  
  468.             MANGLER FILENAME.DOC /- #13I#13#13N#10#13
  469.  
  470.          These three strings do exactly the same thing.  On the command
  471.          line or in a batch file, they tell Mangler to read from MANG-
  472.          LER.DOC, and write to MANGLER.001 (automatically generated in the
  473.          second and third versions; the extra #13 accepts it), inserting
  474.          form-feeds (I) at the default 66 line intervals (^M  or #13 for
  475.          <Enter>), throughout without extra FF's (^M  or #13 to accept the
  476.          default), without cleaning the top of the page (N for No) and
  477.          without removing any header or footer lines (^J or #10 for <Ctrl-
  478.          Enter>), final confirmation (^M or #13) and finally N or n (for
  479.          "No" to "Want to run another round?") to stop without running
  480.          again.  (The 3rd version has no final N, because the "/-" param-
  481.          eter takes care of it.)
  482.  
  483.          Another example: to insert FF's at 56 line intervals and clean
  484.          (remove blank lines) the top of the page, you could use:
  485.  
  486.             MANGLER FILENAME.DOC FILENAME.001 /- I56^MYY
  487.  
  488.          This line runs MANGLER to read MANGLER.DOC and output MANGLER.001.
  489.          /- means no repeats, then we have the string of keystrokes:
  490.  
  491.                 I  insert FF's
  492.                 56 every 56 lines
  493.                 ^M <Enter> to accept the default "Throughout"
  494.                 Y  (another ^M would work, too) for "Yes, clean the top"
  495.                 Y  (or ^M) to confirm the selection.
  496. _______MANGLER 2.61                                                        Page 10
  497.  
  498.  
  499.          In one place, however, there's room for ambiguity, and you'll have
  500.          to touch up the string you get from MANGLER.KEZ.  When you give
  501.          strings to be removed or inserted with DelRep, you might need to
  502.          distinguish between an instruction (like <Enter>) and text to be
  503.          worked on.  Consider this line:
  504.  
  505.               MANGLER FILENAME.TXT FILENAME.001 D#0#0^M#13#10^M^MN
  506.  
  507.                D         DelRep "delete/replace"
  508.                #0#0^M    remove pairs of character #0
  509.             >> #13#10^M  replace them with ASCII newlines <<== WRONG
  510.                ^M        (or Y) to confirm the selection
  511.                N         No, don't run again.
  512.  
  513.          That looks right, and it's what MANGLER.KEZ would give you, but it
  514.          won't work.  Look at the sequence: #13#10^M.  #13 and ^M mean the
  515.          same thing, the carriage return character.  If Mangler reads #13
  516.          it will take it for an <Enter> and set up to remove #0#0 without
  517.          replacing them (then it will get confused by the subsequent char-
  518.                                                           ____         acters).  To explain to Mangler that it's not to obey these char-
  519.                               ______         acters but rather to insert them, put double quotes around them:
  520.  
  521.               MANGLER FILENAME.TXT FILENAME.001 D#0#0^M"#13#10"^M^MN
  522.  
  523.          One last problem: Suppose you want to insert, not the single char-
  524.          acter #13, but the three-character string "#" followed by "1"
  525.          followed by "3".  To do that, put a backslash (\) in front of the
  526.          "#".  That will turn it into a literal "#" and Mangler won't take
  527.          it for an ASCII number mark.  Instead of, say:
  528.  
  529.               MANGLER FILENAME.TXT FILENAME.001 D#0^M"#13"^M^MN
  530.  
  531.          which would replace #0's with carriage returns, use
  532.  
  533.               FILENAME.TXT FILENAME.001 D#0^M"\#13"^M^MN
  534.  
  535.  
  536. A Note About Colors:
  537.  
  538.          PrnSet (2.80 and later) has an option to customize its colors.
  539.          (From PrnSet's main menu, press F3.)  If MANGLER.EXE is on the
  540.          default drive & directory when you run PrnSet's color changer, it
  541.          will change Mangler's colors to match.  The thing to remember is
  542.          that what PrnSet calls the "Frame" color is also used by Mangler
  543.          for its menu bars.  Mangler's uses PrnSet's "Reversed" color for
  544.          its cursor bar, that is, the menu bar currently selected.
  545.  
  546.          If you have no appropriate copy of PrnSet, but can use DEBUG or a
  547.          disk editor, you can change the bytes directly.  Search the file
  548.                                    ___________         for the flag, "COLORS:".  Immediately after the colon are 4 bytes
  549.          specifying the colors, in this order: Normal, Emphasized, Frame,
  550.          and Reversed.  For a monochrome monitor, I'd suggest (in hex
  551.          numbers): 07 0F 07 70 for white-on-black, bright-white-on-black,
  552.          white-on-black, black-on-white.
  553. _______MANGLER 2.61                                                        Page 11
  554.  
  555.  
  556. Version History:
  557.  
  558.    1.10  adds "Blank Ends" stripping feature. (7/89)
  559.  
  560.    1.20  adds "Split File" and "Insert FF's." (8/89)
  561.     .21  repairs bug in "Insert FF's." (8/89)
  562.  
  563.    1.30  More repairs but also: InsFF will now respect FF's instead of re-
  564.            moving them.  Option to remove blank lines at top as well as
  565.            bottom of page. (8/89)
  566.     .31  Prevent occasional extra FF at end of InsFF. (9/89)
  567.     .32  Repair to line reading procedure: FF is an end-of-line char,
  568.            just like LF. (9/89)
  569.     .33  CrSwap was converting 1st char of each line to FF. (9/89)
  570.  
  571.    1.40 Add and Strip margin can add/strip after CR's also.  Also adds
  572.            option to remove non-blank header &/or footer lines. 1.40b in-
  573.            sures FF not on end of line, 1.40c fixes bug about how many
  574.            footer lines to remove, and 1.40d stops it adding extra LF af-
  575.            ter FF. (10/89)
  576.     .41  Remove margin & Add margin options can handle tabs by expand-
  577.            ing tabs with the proper number of blanks. (12/89)
  578.     .42  More complete tab handling.  "Blanks" option (formerly called
  579.            "LnEnds") can Expand tabs or pack blanks into tabs.  At pres-
  580.            ent, tabs are set at the standard 8-column intervals.  Bug fix
  581.            in DelChr character entry. (12/89)
  582.     .43  Option to insert extra FF's added, menus reorganized, <Esc> backs
  583.            up through menus more smoothly and will now stop execution.
  584.            Somewhat less liable to hang on Ctrl-Break.  Remove terminal
  585.            blanks feature works properly. (2/90)
  586.     .44  DelChr option can now create a file without CR's or LF's alto-
  587.            gether, not even in the newlines. (6/90)
  588.  
  589.    1.50  Adds "Revrse" option to reverse the order of pages.  Also, manu-
  590.            factures and suggests an output file name --the input file name
  591.            with extension 001 or, if input file extension has a numerical
  592.            value, you get the next higher number, 002, 003, etc. (7/90)
  593.     .51  Fixes a serious bug in the Reverse option and minor ones in Del-
  594.            Chr about removing newline (CR/LF) pairs. (12/90)
  595.  
  596.    1.60  Adds the "+" option to cycle Mangler repeatedly.
  597.     .60a Corrects readout for files with more than 32K lines.(8/91)
  598.     .60b Asks whether to cycle again.  Makes "+" obsolete.
  599.  
  600.    1.70  Adds keyboard stuffing from the command line.  Now, Mangler
  601.            can run from a batch file without responses from the key-
  602.            board.  Naturally, this rehabilitates /+ & /-. (10/91)
  603.     .71  Can adjust tab width for "Blanks" and "Margins" functions.
  604.  
  605.    2.00  Uses (but not fully) new line handling system which can handle
  606.            almost indefinitely long lines (about 30K characters).  No
  607.            new functions but heavy internal reworking justifies the "2.00"
  608.            (it'll have different bugs).  Also, CrSwap now ignores all but
  609.            the first bare CR in each line. (2/92)
  610. _______MANGLER 2.61                                                        Page 12
  611.  
  612.  
  613.    2.20  Two important changes: (1) Now uses the new long line handling sys-
  614.            tem consistently in all functions.  (2) The old "DelChr" func-
  615.            tion is replaced by "DelRep", which differs in two respects: it
  616.            can handle strings of up to 50 characters), & it can replace
  617.            as well as delete.  Smaller fixes: (a) Output file has the same
  618.            date and time as the original (convenient if you want Pagina to
  619.            include the date in its header).  (b) Abandons the pretense that
  620.            you have to use "Blanks" to remove blank line-ends (for some
  621.            time, Mangler's been doing it automatically).  Now, it's renamed
  622.            "Tabs" and simplified.  Finally: (c) InsFF no longer adds a blank
  623.            header line at the top of page. (7/92)
  624.     .20a Repairs method of distinguishing commands from text in DelRep
  625.            strings.  Now uses "double quotes" to indicate text. (8/92)
  626.     .20b Repairs fault in /REC function (probably introduced in .20a).
  627.     .20c Repair in command line reading and some cosmetic improvements.
  628.  
  629.    2.21  Does 2 things: Fixes bug in Turbo Pascal's reset: balks at non-
  630.            text files if they're read-only.  Works around by using text
  631.            files where possible and changing attribute temporarily if file
  632.            must be opened as non-text (but see .21c below)  Second, the
  633.            Hi-Bit option now offers a choice to preserve character graphics
  634.            boxes with "-", "|" etc.
  635.     .21a Minor bugfix (confirmation line for DelRep).
  636.     .21b Bugfix: SpFile was losing 1st section.  (Bug probably introduced
  637.            in 2.00 or 2.10.)
  638.     .21c Proper way to read read-only files discovered and implemented.
  639.            (Internet newsgroups are a wonderful invention.)
  640.     .21d Minor fix in Hi-bit graphics boxes.  (#128 wasn't being trans-
  641.            lated.)  Straightened SpFile numbering some more (1/93).
  642.  
  643.    2.30  New function: if asked to replace a string with itself, DelRep
  644.            will merely count the occurences of the string in the source
  645.            file without creating any output file at all. (2/93)
  646.     .30a Stops an otiose newline being tacked onto the last FF. (3/93)
  647.     .30b SpFile display keeps you posted on current output file. (3/93)
  648.  
  649.    2.40  New hi-bit function: besides converting graphics line-drawing
  650.            characters to ordinary printable ones like "-" and "|", Mangler
  651.            can reverse the process and pretty up low-bit boxes and lines.
  652.            by substituting high-bit graphics characters.  Generally, the
  653.            whole hi-bit system is neatened with a moving-bar menu. (4/93)
  654.     .40a Bugfix: DelRep replacing 1 char with string was looping. (5/93)
  655.  
  656.    2.50  "Margin" and "Tabs" options also neatened with moving-bar menus.
  657.            "Margin" has new functions: add blanks to pad lines to a given
  658.            length or strip blanks & tabs from the ends of lines. (6/93)
  659.  
  660.    2.51  /? syntax help screen added. (7/93)
  661.     .51a Repaired InsFF "extra" FF insertion.  Broken some time in the
  662.            last few versions. (8/93)
  663.  
  664.    2.52 Margin Remove/Add can handle more than one CR per line. (12/93)
  665. _______MANGLER 2.61                                                        Page 13
  666.  
  667.  
  668.    2.53 Can work properly on 43 & 50 line screens.  (7/94)
  669.  
  670.    2.60 New: can soften "hard" ASCII returns for word-processors. (7/94)
  671.     .61 Fixed: DelRep ignores lines; doesn't insert its own line-ends,
  672.           Now correctly changes and removes CR &/or LF. (11/94)
  673.  
  674.  
  675.                                About Updates
  676.  
  677.      Updates to my programs appear irregularly and sometimes frequent-
  678.      ly, as bugs and suggestions are brought to my attention.  Since I
  679.      make no charge for these things, I can't afford to send updates
  680.      everywhere.  One place I do try to keep up to date is Nelson
  681.      Ford's "Public (software) Library":
  682.  
  683.                        The Public (software) Library
  684.                               P.O. Box 35705
  685.                           Houston, TX 77235-5705
  686.  
  687.      Since the PsL is prompt both in updating their material and in
  688.      filling their orders, they're one place where you can be sure of
  689.      getting my latest efforts.  It is not unethical to take my pro-
  690.                                                           __     grams off a PsL disk and package them yourself.  (It is unethical
  691.      and probably illegal to copy the whole PsL disk including other
  692.      programs and the PsL's own explanatory files and programs.)
  693.  
  694.      Of course, people who send me suggestions and bug reports are
  695.      liable to be sent a copy of the fix (if I can make one).  They're
  696.      also liable to be drafted into my Beta Testing Division.
  697.  
  698.                                                 R. N. Wisan, December, 1994
  699.                                           37 Clinton St., Oneonta, NY 13820
  700.                                               internet: wisanr@hartwick.edu